namespace ScrumSprintMonitor.Infrastructure
{
    public static class WorkItemAdapterExtensions
    {
        public static bool IsOpen(this IWorkItemAdapter adapter)
        {
            return adapter.State != WorkItemState.Deleted && adapter.State != WorkItemState.Done;
        }

        public static double GetReportableRemainingWork(this IWorkItemAdapter adapter)
        {
            return adapter.IsOpen() ? adapter.RemainingWork : 0.0;
        }
    }
}